const Webpack = require('webpack')
const path = require('path')
const webpackConfig = require('./webpack.config.js')
const { merge } = require('webpack-merge')

const VUE_APP_BASE_API = '' // 开发环境代理地址

module.exports = merge(webpackConfig, {
  mode:'development',
  devtool: false,
  devServer:{
    port: 8080,
    hot: true,
    proxy: {
      'api': {
        target: VUE_APP_BASE_API,
        changeOrigin: true,
        pathRewrite: {
          '^api': ''
        },
      },
    },
    contentBase: path.join(__dirname, 'dist')
  },
  plugins: [
    new Webpack.HotModuleReplacementPlugin() // 热更新
  ]
})